package com.zheng.mall.common.exception;

import com.zheng.mall.common.api.RequestErrorCode;

/**
 * 自定义API异常
 * @author zheng
 */
public class ApiExceptions extends RuntimeException {
    private RequestErrorCode errorCode;

    public ApiExceptions(RequestErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public ApiExceptions(String message) {
        super(message);
    }

    public ApiExceptions(Throwable cause){
        super(cause);
    }

    public ApiExceptions(String message, Throwable cause) {
        super(message, cause);
    }

    public RequestErrorCode getErrorCode() {
        return errorCode;
    }
}

